<template>
    <el-dialog v-model="visible" :close-on-press-escape="false" :title="title" :width="width">
        <el-input placeholder="搜索"/>
        <el-table :data="resumeData" @row-dblclick="selectRow">
            <el-table-column prop="name" label="姓名"/>
            <el-table-column prop="contactPhone" label="联系电话"/>
            <el-table-column prop="resumeClassify.positionName" label="应聘岗位"/>
        </el-table>
        <template #footer>
            <el-button type="default" @click="visible=false">取消</el-button>
            <el-button type="default" @click="this.$emit('clear-select')">清除</el-button>
        </template>
    </el-dialog>
</template>

<script>
import {getResumeWindowData} from "../../../../network/resume";

export default {
    name: "ResumeWindow",
    props:['width'],
    emits: ['clear-select','select-row'],
    data(){
        return{
            visible: false,
            title: '简历库',
            resumeData: []
        }
    },
    methods:{
        selectRow(row, column, event){
            // console.log('row',row)
            // console.log('column',column)
            // console.log('event',event)
            this.$emit('select-row',this.$utils.clone(row))
            this.visible = false
        },
        clearSelect(){
            this.$emit('clear-select')
            this.visible = false
        },
        init(){
            getResumeWindowData().then(data=>{
                console.log('data',data)
                this.resumeData = data.data;
            })
        }
    },
    created() {
        this.init();
    }
}
</script>

<style scoped>

</style>